#include "StdAfx.h"
#include "TTChatMessageHandler.h"
#include "TTChatClient.h"

CTTChatMessageHandler::CTTChatMessageHandler(void)
{
	m_pTTClient=0;
}

CTTChatMessageHandler::CTTChatMessageHandler( CTTChatClient* pClient )
{
	m_pTTClient=pClient;
}

CTTChatMessageHandler::~CTTChatMessageHandler(void)
{
}

void CTTChatMessageHandler::handleMessage( Stanza *stanza, MessageSession *session /*= 0*/ )
{
	string caMsg=stanza->body();
	TTChatGlobal::TTMsg pTTMsg;
	pTTMsg.jid=stanza->from().bare();
	pTTMsg.msg=stanza->body();
	if(m_pTTClient){
		::SendMessage(m_pTTClient->m_hMainWnd,TTChatGlobal::TM_MSG_COMMING,(WPARAM)&pTTMsg,NULL);
	}
}
